package com.xiyue.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sport.model.dto.Option;
import com.sport.model.entity.SysPermission;
import com.sport.model.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {
    List<Option> getRolesByUserId(@Param("userId") String id);

    void insertRoleIds(@Param("userId") String id,@Param("roleIds") List<Object> roleIds);

    void deleteByUserId(@Param("userId") String id);

    List<String> getRoleCodeByUserId(String userId);

    List<String> getPermissionByRoleCode(String roleCode);

    List<SysPermission> listParentMenuByUserId(@Param("userId") String userId);

    List<SysPermission> listMenuByUserId(@Param("userId") String userId,@Param("parentId") String id);
}
